# 使用Debian的slim版本作为基础镜像
FROM debian:buster-slim
# 替换为清华大学TUNA镜像源
RUN sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list \
    && sed -i 's/security.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list \
    && apt-get update && apt-get install -y snmp snmpd

# 需要非自由软件包源(non-free repositories)来安装完整的MIB包
RUN sed -i 's/main/main non-free/' /etc/apt/sources.list \
    && apt-get update && apt-get install -y snmp-mibs-downloader

# 拷贝你的SNMPD配置文件到容器中
#COPY snmpd.conf /etc/snmp/

# 开放161端口，SNMP标准端口
EXPOSE 161/udp

# 启动snmpd服务
CMD [ "snmpd", "-f", "-Lo" ]
